home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / unix / src / mkdir.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-26  |  426 b   |  21 lines

  1. #include "amiga.h"
  2. #include <stdarg.h>
  3.  
  4. int mkdir(char *name, mode_t mode)
  5. {
  6.   BPTR lock;
  7.   long amode;
  8.  
  9.   chkabort();
  10.  
  11.   if (lock = CreateDir(name))
  12.     {
  13.       UnLock(lock);
  14.       /* We remove script because mode 777 contains it by def, but it is
  15.          meaningless for directories */
  16.       amode = _make_protection(mode) & ~(FIBF_SCRIPT);
  17.       if (SetProtection(name, _make_protection(mode))) return 0;
  18.     }
  19.   ERROR;
  20. }
  21.